package com.imooc.news_manager_project.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

@Data
@Document(collection = "news")
@Accessors(chain = true)
public class News {

    @Id
    private String id;

    @Field("auth_id")
    private Integer authId;
    @Field("title")
    private String title;
    @Field("content")
    private String content;

    @Field("create_time")
    private Date createTime;

    @Field("update_time")
    private Date upateTime;

    @TableField(exist = false)
    private Long numVisitor;

}
